package com.cooper.entity;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

import com.cooper.domain.Entity;

public class UserInfo extends Entity{
	private static final long serialVersionUID = 5616041728891066493L;
	
	public static final String STATUS_INACTIVE = "2";
	
	private Long groupId;
	private String userName;
	private String userNick;
	private String userPassword;
	private String email;
	private String gender;
	private String userFileId;
	private String userType;
	private Timestamp birthday;
	private Timestamp gmtLastLogin;
	private String birthdayStr;
	
	/** invalid-无效, normal- 有效, inactive -未激活 */
	private String status;
	
	private int administrator;

	public Long getGroupId() {
		return groupId;
	}

	public void setGroupId(Long groupId) {
		this.groupId = groupId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserNick() {
		return userNick;
	}

	public void setUserNick(String userNick) {
		this.userNick = userNick;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	public Timestamp getGmtLastLogin() {
		return gmtLastLogin;
	}

	public void setGmtLastLogin(Timestamp gmtLastLogin) {
		this.gmtLastLogin = gmtLastLogin;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public int getAdministrator() {
		return administrator;
	}

	public void setAdministrator(int administrator) {
		this.administrator = administrator;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getUserFileId() {
		return userFileId;
	}

	public void setUserFileId(String userFileId) {
		this.userFileId = userFileId;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public Timestamp getBirthday() {
		return birthday;
	}

	public void setBirthday(Timestamp birthday) {
		this.birthday = birthday;
	}

	public String getBirthdayStr() {
		DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		if(this.getBirthday()!=null){
			return this.birthdayStr = sdf.format(birthday);
		}
		return birthdayStr;
	}

	public void setBirthdayStr(String birthdayStr) {
		this.birthdayStr = birthdayStr;
	}
	
}

